/*
 * Block.java
 */
package strips;

/**
 *
 * @author mire
 */
public class Block {

    protected String name;

    public Block(String name) {
        this.name = name;
    }

    public Block() {
        this.name = "Unknown";
    }

    public Block(Block b) {
        this.name = b.getName();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Block other = (Block) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name;
    }
}
